package com.example.exam.service;

import com.example.exam.entity.ExamPaperAnswer;

import org.springframework.data.domain.Page;

import java.util.List;


/**
 * @author shishuqian
 * date 2021/4/27
 * time 15:26
 **/
public interface ExamPaperAnswerService {

    //保存试卷答案
    int save(ExamPaperAnswer examPaperAnswer);

    //根据用户id和试卷id查找答题卷
    List<ExamPaperAnswer> findByUserIdAndExamPaperId(Integer user_id, Integer examPaper_id);

    ExamPaperAnswer findById(Integer exam_paper_answer_id);

    //根据用户id分页查询试卷，根据创建时间降序排列
    Page<ExamPaperAnswer> findExamPaperAnswersByUserId(Integer user_id, Integer page, Integer size);

    //获取未批改/已批改的试卷
    Page<ExamPaperAnswer> getCheck(Integer examPaperId, Integer status, Integer page, Integer size);

    Page<ExamPaperAnswer> findByPaperNameLike(String paperName,Integer userId,Integer page,Integer size);

    List<String> findNamesByPaperId(Integer examPaperId);
}
